package com.example.entity.vo.request.auth;

import jakarta.validation.Valid;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

/**
 * 邮箱注册请求参数对象，用于接收用户通过邮箱方式注册时提交的数据
 *
 * @auth shanyue
 * @date 2025年06月23日14:55
 */
@Data
@Valid
public class EmailRegisterVO {

    //允许中英文和数字
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]+$", message = "用户名只能包含中英文和数字")
    @Length(min = 2, max = 20, message = "用户名长度必须在2到20之间")
    private String username;

    @Length(min = 6,max = 20)
    private String password;

    @Email(message = "邮箱格式不正确")
    private String email;

    @Length(min = 6,max = 6,message = "验证码必须为6位")
    private String code;

}
